package com.o2o.service;

import com.o2o.dto.LocalAuthExecution;
import com.o2o.entity.LocalAuth;
import com.o2o.exceptions.LocalAuthOperationException;

import java.util.Date;

/**
 * package_name:com.o2o.service
 * Author:徐亚远
 * Date:2019/12/25 21:36
 * 项目名:o2o
 * Desription:
 **/
public interface LocalAuthService {
    /*
     * 通过账户密码获取平台信息
     * @param username
     * @param password
     * @return
     * */
    LocalAuth getLocalAuthByUsernameAndpwd(String username, String password);

    /*
     * 通过userId获取平台信息
     * @param userId
     * @return
     * */
    LocalAuth getLocalAuthByUserId(long userId);

    /*
     * 绑定微信,生成平台专属的账户
     * @param  localAuth
     * @return
     * @throws RuntimException
     * */
    LocalAuthExecution bindLocalAuth(LocalAuth localAuth) throws LocalAuthOperationException;

    /*
     * 修改平台账户的登陆密码
     * @param localAuthId
     * @param username
     * @param password
     * @param newPassword
     * @param lastEditTime
     * @return
     * */
    LocalAuthExecution modifyLocalAuth(Long userId,
                                       String username,
                                       String password,
                                       String newPassword,
                                       Date lastEditTime) throws LocalAuthOperationException;
}
